<?PHP $this->_extends('_layouts/manager_layout');?>
<?PHP $this->_block('head');?>

<?PHP $this->_endblock();?>
<?PHP $this->_block('contents');?>
<h2 class="aa1">我的订单</h2>
<?php if(isset($success)&&is_array($success)): ?>
	<div class="success">
		<?php foreach($success as $k=>$v):
			switch($k){
				case 'notification':
					foreach($v as $oid){
						echo '订单: '.$oid.' , 回馈成功 .<br>';
					}
				break;
		?>
			
		<?php } endforeach;?>
	</div>
	<?php	endif;?>
	<?php if(isset($error)&&is_array($error)): ?>
	<div class="error">
		<?php  foreach($error as $k=>$v):
			switch($k){
				case 'notification':
					foreach($v as $oid){
						echo '订单: '.$oid.' , 回馈 失败 .<br>';
					}
				break;
		?>
			
		<?php } endforeach;?>
	</div>
	<?php	endif;?>
<div style="padding:10px 10px">
	<input id="checkNegative" type="checkbox" title='反选'>反,
	<a href="#" onclick="$('input[name^=order_id]').attr('checked','checked');return false;">全选</a>
</div>
<?php if(isset($orders)&&count($orders)):?>
<form action="" method="post">
<table width="100%" cellpadding="3" cellspacing="0" class="liststyle">
  <col class="span-1"></col>
  <col class="span-5 ColColorGray">
  </col>
  <!--<col></col>-->
  <col class="span-5">
  </col>
  <col class="span-3 ColColorOrange">
  </col>
  <col class="span-5">
  </col>
  <thead>
    <tr>
	  <th></th>
      <th>Order Id</th>
      <th>Date</th>
      <th>Amount</th>
      <th>Status</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach($orders as $order):?>
    <tr>
	  <td><input type="checkbox" name="order_id[<?=$order->order_id?>]" value="<?=$order->order_id?>" /> </td>	
      <td style="font-size:17px ; font-weight:bold"><a href="<?=url('default/order',array('order_id'=>$order->order_id))?>" target="_blank_order"><?=$order->order_id?></a></td>
      <td><?=date('Y-m-d H:i:s',$order->created)?></td>
      <td class="textright"><?=$order->finel_amount.' '.$order->currency?></td>
      <td style="text-align:left">payment ：<?=$order['status_payment']?><br />
		  shipment : <?=$order['status_shiped']?>
      </td>
    </tr>
	<?php endforeach;?>
  </tbody>
</table>
<div style="padding:10px 10px">
	<input id="checkNegative2" type="checkbox" title='反选'>反,
	<a href="#" onclick="$('input[name^=order_id]').attr('checked','checked');return false;">全选</a>
	<select name="cmd">
		<option value="">you want to</option>
		<option value="sendNotification">Send Notification</option>
	</select>
	&nbsp;&nbsp;&nbsp;
	<input type="submit" value="submit"  />
</div>
<?php else:?>
<p id="cart-none-msg">
<div class="notice">
	No orders In This session !
</div>
</p>
<?php endif;?>
<br />
<?php $this->_control('pagination2','collection-list2',array('pagination'=>$pager,'url_args'=>$url_args)) ?>

<br>
</div>
<script language="javascript">
$('#checkNegative,#checkNegative2').click(function(){
	$('input[name^=order_id]').each(function(){
		if($(this).attr('checked')){
			$(this).removeAttr('checked');
		}else{
			$(this).attr('checked','checked');
		}
	});
})
</script>
<?PHP $this->_endblock();?>

